<#--POJO-STATS-->
<#-- 传入参数 Func func, DataTable table --> 
package ${func.javaPkg}.pojo;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.math.RoundingMode;
import com.vecspace.database.model.DefaultAggregateEntity;

/** ${table.tableCaption!} 统计数据
 * @template dayu-code-builder
 * @author ${author}
 * @reviewer 
 * @createTime ${nowTime}
 */
public class ${table.className}Stats extends DefaultAggregateEntity implements java.io.Serializable {
    private static final long serialVersionUID = 300${table.id?c}L;

    public ${table.className}Stats(){
    }
/*********************** 分组字段 ****************************/
<#list columns as column>
  <#if column.aggregateGroup!false == true>
    /**${column.columnCaption!''}*/
    private ${column.javaType} ${column.varName};
  </#if>
</#list>

<#list columns as column>
  <#if column.aggregateGroup!false == true>
    /**${column.columnCaption!''}*/
    @Column(name = "${column.columnName?upper_case}")
    public ${column.javaType} get${column.propName}(){
        return this.${column.varName};
    }
    /**${column.columnCaption!''}*/
    public void set${column.propName}(${column.javaType} ${column.varName}){
        this.${column.varName} = ${column.varName};
    }
    
  </#if>
</#list>

/*********************** 聚合字段 ***************************/
<#list columns as column>
  <#list column.aggregateColumns as aggColumn>
    /**${column.columnCaption!''} ${aggColumn.columnCaption!''}*/
    private ${aggColumn.javaType} ${aggColumn.varName};
  </#list>
</#list>
<#list columns as column>
  <#list column.aggregateColumns as aggColumn>
    /**${column.columnCaption!''} ${aggColumn.columnCaption!''}*/
    @Column(name = "${aggColumn.columnAliasName?upper_case}")
    public ${aggColumn.javaType} get${aggColumn.propName}(){
        return this.${aggColumn.varName};
    }
    /**${column.columnCaption!''} ${aggColumn.columnCaption!''}*/
    public void set${aggColumn.propName}(${aggColumn.javaType} ${aggColumn.varName}){
<#if aggColumn.javaType=="BigDecimal">
        if(${aggColumn.varName} != null){
            ${aggColumn.varName} = ${aggColumn.varName}.setScale(${aggColumn.dataScale!0}, RoundingMode.HALF_UP);
        }
</#if>
        this.${aggColumn.varName} = ${aggColumn.varName};
    }
    
  </#list>
</#list>

    @Override
    public String getKey() {
        // TODO Auto-generated method stub
        return null;
    }
}
